<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Simpay_test extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->load->library('smarty3', '', 'smarty');

        require (APPPATH.'libraries/pay/simpay/simpay.php');
    }

    // --------------------------------------------------------------------
    function index() {
        
        $paymentID = time(); // payment ID bên anh tu sinh, unique nhé
        $pvAmount = '10000';           // so tien
        $serviceID = '9852';          // mã dich vu==> bên simpay cung cap
        $pvAccount = '';   // so dien thoai khách hàng
        $receiptID = time();          // receiptIDID bên anh tu sinh, unique nhé  receiptID+ paymentID dedoi soát
        $currentDate = date("Y-m-d\TH:i:s");

        $simpay = new Simpay();
        $request = $simpay->addOffLinePayment($paymentID, $pvAmount, $serviceID, $pvAccount, $receiptID, $currentDate);
        echo $request['code'];exit;
//        if($request == -1)
//        {
//            echo 'Lỗi kết nối.';
//        }
//        else
//        {
//            $login_simpay = $request->attributes();
//            switch($login_simpay)
//            {
//                case 0:
//            }
//        }
    }

    function getCard()
    {
        
        $paymentID = '1375093634';
        $simpay = new Simpay();
        $simpay->getPaymentStatus($paymentID);
    }
}

/* End of file rss.php */
/* Location: ./system/application/controllers/rss.php */